class MineFollowListModel {
  String msg;
  List<FollowModel> data;

  MineFollowListModel({this.msg, this.data});

  MineFollowListModel.fromJson(Map<String, dynamic> json) {
    msg = json['msg'];
    if (json['data'] != null) {
      data = new List<FollowModel>();
      json['data'].forEach((v) {
        data.add(new FollowModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['msg'] = this.msg;
    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class FollowModel {
  String followType;
  String username;
  String mobile;
  String avatar;
  String bio;
  String followRemark;

  String get remarkname {
    if(username == null && followRemark == null) return mobile;
    return followRemark == null ? username : followRemark;
  }

  /// 只会在我的星域里面用到，默认为true
  bool isfollow;

  FollowModel({this.followType, this.username, this.mobile, this.avatar, this.isfollow = true, this.followRemark});

  FollowModel.fromJson(Map<String, dynamic> json) {
    followType = json['follow_type'];
    username = json['username'];
    mobile = json['mobile'];
    avatar = json['avatar'];
    followRemark = json["follow_remark"];
    bio = json["bio"];
    isfollow = true; 
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['follow_type'] = this.followType;
    data['username'] = this.username;
    data['mobile'] = this.mobile;
    data['avatar'] = this.avatar;
    data["bio"] = this.bio;
    return data;
  }
}